package com.yuxiang.flowable.result;

/**
 * @author : yx-0176
 * @description
 * @date : 2022/3/9
 */
public class PageResult<T> extends BaseResult {

    private static final long serialVersionUID = 8233713204372810599L;
    private PageData<T> data;

    public PageData<T> getData() {
        return data;
    }

    public void setData(PageData<T> data) {
        this.data = data;
    }

    public static <T> PageResult<T> buildData(PageData<T> data){
        PageResult<T> result = new PageResult<>();
        result.setData(data);
        result.setSuccess(true);
        result.setCode(ResultCode.SUCCESS.getCode());
        result.setMessage(ResultCode.SUCCESS.getMessage());
        return result;
    }

}
